package com.cqut.dao.base;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.List;

import org.hibernate.Query;

public interface DAO {
	public abstract <T> void delete(Class<T> entity, Serializable entityId);

	public abstract <T> void delete(Class<T> entity, Serializable[] entityIds);

	public abstract <T> T findById(Class<T> entity, Serializable entityId);

	public abstract <T> T loadById(Class<T> entity, Serializable entityId);

	@SuppressWarnings("unchecked")
	public abstract <T> T findOneBySql(Class<T> entity, String whereSql,
			Object[] params);

	public abstract <T> Long getSingleResult(Class<T> entity);

	public abstract void saves(Object[] entitys);

	public abstract void save(Object entity);

	public abstract void update(Object entity);

	public abstract void updates(Object[] entitys);

	public Long getEntityCount(String hql);

	public Integer executeUpdate(String hql);
	
	public <T> List<T> executeQuery(String hql);

	public <T> List<T> find(String queryStirng, final Long firstResult,
			final Long maxResults);

	public <T> List<T> find(String queryStirng,
			LinkedHashMap<String, Object> linkedHashMap,
			final Long firstResult, final Long maxResults);

	public Long getEntityCount(String hql,
			LinkedHashMap<String, Object> linkedHashMap);

	public abstract List findByExample(String entityName, Object exampleEntity);
}